package com.ctosb.classviewer.clazz.attr;

import com.ctosb.classviewer.ClassReader;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class BootstrapMethods_attribute extends Attribute_info {

    private short num_bootstrap_methods;
    private Bootstrap_method bootstrap_methods[];

    @Override
    protected void doParse(ClassReader classReader) {
        num_bootstrap_methods = classReader.readShort();
        bootstrap_methods = new Bootstrap_method[num_bootstrap_methods & 0xffff];
        for (int i = 0; i < bootstrap_methods.length; i++) {
            bootstrap_methods[i] = new Bootstrap_method().parse(classReader, getClassFile());
        }
    }
}
